package com.demo.demo.controller;

import com.demo.demo.entity.Class;
import com.demo.demo.service.ClassService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.Date;

@Controller
public class PageController {
    @Autowired
    private ClassService classService;
    private int i=0;
    @RequestMapping("/find/{id}")
    public @ResponseBody Class index(@PathVariable String id)throws Exception{
        i++;
        System.out.println(i);
        return classService.selectClassById(id);
    }
    @RequestMapping("/login/{date}")
    @ResponseBody
    public  Date index(@PathVariable Date date)throws Exception{
        System.out.println(date);
        return date;
    }


}
